<template>
	<div class="home">
		<div>
			<h3>LCalendar移动端时间选择</h3>
			<div>
				<input v-bind:id="name" type="text" readonly="" placeholder="时间选择特效" />
			</div>
		</div>

	</div>
</template>

<script>
	import $ from 'jquery'
	import LCalendar from '../../common/date-picker/LCalendar'
	export default {
		components: {
			
		},
		props: {
			name: {
		      type: String,
		      default: 'minute_select'
		   },
		    initial_value: {
		      type: String,
		      default:''
		    },
		    max_date: {
//		      type: String,
		      default: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
		    },
		    min_date: {
//		      type: String,
		      default: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
		    },
		    disable: {
		      type: String,
		      default: undefined
		    }
		  },
		data() {
			return {
				
			}
		},
		mounted: function() {
			var calendar = new window.LCalendar();
			var that = this;
			console.log(that.max_date)
			calendar.init({
				'trigger': '#'+that.name, //标签id
				'type': 'time', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
				'minDate': that.min_date, //最小日期
//				'maxDate': new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate() //最大日期
				'maxDate':that.max_date
			});
			var dom = $('#'+that.name)
			dom.val(that.initial_value)
		},
		methods: {
			changes(item){
				var that = this;
				var dom = $('#'+that.name)
				console.log(dom.val())
			}
		}
	}
</script>
<style lang="less" >
	@import '../../common/less/base.less';
	
</style>